package com.ruoyi.lhky.controller;

import com.ruoyi.lhky.service.WorkplaceService;
import com.ruoyi.lhky.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/workplace")
@Tag(name = "工作单位管理", description = "工作单位的相关操作")
public class WorkplaceController {

    @Autowired
    private WorkplaceService workplaceService;

    @GetMapping("/list")
    @Operation(summary = "获取工作单位列表", description = "获取所有工作单位的列表")
    @ApiResponses({
            @ApiResponse(responseCode = "200", description = "获取成功"),
            @ApiResponse(responseCode = "500", description = "服务器内部错误")
    })
    public R list() {
        return workplaceService.list();
    }
}
